package com.antoni.sboot_helloword.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @Author Zhang Chao
 * @Date 2021/5/10 13:40
 * @Version 1.0
 */
@Component  //注册bean到容器中
public class Dog {

    @Value("阿黄")
    private String name;
    @Value("18")
    private Integer age;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Dog{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
